package com.labot.service;

import java.util.List;

import com.labot.dao.ConfigDao;
import com.labot.model.Config;
import com.labot.types.ConstantsGrupsType;
import com.labot.types.ConstantsType;


/**
 * Business Service Interface to handle communication between web and
 * persistence layer.
 *
 * @author Ing. Enrique Barbeito
 * 
 */
public interface ConfigManager extends GenericManager<Config, Long> {
    /**
     * Convenience method for testing - allows you to mock the DAO and set it on an interface.
     * @param ConfigDao the ConfigDao implementation to use
     */
    void setConfigDao(ConfigDao configDao);

    
    /**
     * Get all Config by Group listings
     * @return
     */
    public List<Config> getConfigs(ConstantsGrupsType type);

    /**
     * Get all Configs
     * @param type
     * @return
     */
    public List<Config> getAllConfigs();


    /**
     * Modify a value to a Config.
     * @param id
     * @param value
     * @return
     * @throws Exception
     */
    public Config modifyConfig(Long id, String value) throws Exception;
    
    /**
     * Create an empty Config Constant
     * 
     * @param key
     * @return
     * @throws Exception
     */
    public Config createNewConfig(ConstantsType key) throws Exception;
    
    /**
     * Get a Config Constant from the DB
     * 
     * @param key
     * @return
     * @throws Exception
     */
    public Config getConfig(ConstantsType key) throws Exception;
    
    /**
     * Delete Deprecated Keys
     * 
     * @throws Exception
     */
    public void deprecateConstants() throws Exception;
}
